<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./utils.js"></script>
    <title>Document</title>
</head>
<br>
    <h1>日期格式化</h1>
    <div id="demo1"></div>
    <script>
    var result=""
    result+="dateFormat('2021-10-5 12:00:00')//"+dateFormat('2021-10-5 12:00:00')+"</br>"
    result+="dateFormat('2021-8-15 12:00:00')//"+dateFormat('2021-8-15 12:00:00')+"</br>"
    result+="dateFormat('2021-6-7 12:00:00')//"+dateFormat('2021-6-7 12:00:00')+"</br>"
    result+="dateFormat('2021-4-5 12:00:00')//"+dateFormat('2021-4-5 12:00:00')+"</br>"
    document.querySelector("#demo1").innerHTML=result
    </script>


<h1>快速获取当前时间</h1>
<div id="demo2"></div>
<script>
    var result=""
    result+="format('YmdHis')//"+format('YmdHis')+"</br>"
    result+="format('Y-m-d H:i:s')//"+format('Y-m-d H:i:s')+"</br>"
    result+="console.log(format('Y/m/d'))//"+format('Y/m/d')+"</br>"
    result+="format('Y/m/d H:i:s')//"+format('Y/m/d H:i:s')+"</br>"
    result+="format('Y年m月d日 H:i:s')//"+format('Y年m月d日 H:i:s')+"</br>"
    result+="format('Y')//"+format('Y')+"</br>"
    result+="format('m')//"+format('m')+"</br>"
    result+="format('d')//"+format('d')+"</br>"
    result+="format('H')//"+format('H')+"</br>"
    result+="format('i')//"+format('i')+"</br>"
    result+="format('s')//"+format('s')+"</br>"
    document.querySelector("#demo2").innerHTML=result
</script>


<h1>字符串补零</h1>
<div id="demo2"></div>
<script>
var result = ''
result += `zeroize(1)~~~~~${zeroize(1)}<br>`
result += `zeroize(3)~~~~~${zeroize(3)}<br>`

document.querySelector('#demo2').innerHTML = result
</script>


<h1>获得一个十六进制的随机颜色的字符串</h1>
<div id="demo3"></div>
<script>
    var result=""
    result+="random()//"+random()+"</br>"
    result+="random()//"+random()+"</br>"
    result+="random()//"+random()+"</br>"
    result+="random()//"+random()+"</br>"
    result+="random()//"+random()+"</br>"
    result+="random()//"+random()+"</br>"
    document.querySelector("#demo3").innerHTML=result
</script>


<h1>判断浏览器类型</h1>
<div id="demo4"></div>
<script>
    var result = ''
    result += `getOs()~~~~~~~~~~${getOs()}<br>`
    document.querySelector('#demo4').innerHTML = result
</script>


<h1>判断是PC还是移动端</h1>
<div id="demo5"></div>
<script>
    var result = ''
    result += `getPCMob()~~~~~~~~~~${getPCMob()}<br>`
    document.querySelector('#demo5').innerHTML = result
</script>


<h1>判断是否是微信内置浏览器</h1>
<div id="demo6"></div>
<script>
    var result = ''
    result += `getWX()~~~~~~~~~~${getWX()}<br>`
    document.querySelector('#demo6').innerHTML = result
</script>


<h1>获取非行内样式</h1>
<div id="demo7"></div>
<script>
    var result=""
    var background = getStyle(document.querySelector('div'), 'background')
    var color = getStyle(document.querySelector('div'), 'color')
    result+="background//"+background+"</br>"
    result+="color//"+color+"</br>"
    document.querySelector("#demo7").innerHTML=result
</script>